/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Lixo;

import com.sun.j3d.utils.universe.Viewer;
import com.sun.j3d.utils.universe.ViewingPlatform;
import javax.media.j3d.*;
import javax.media.j3d.VirtualUniverse;

/**
 *
 * @author fosa
 */
public class UniversoSimples extends VirtualUniverse {

    protected Viewer View;
    protected Locale Local;
//    BranchGroup

    public UniversoSimples() {
        super();
        View = new Viewer();
        Local = new Locale(this);
        BranchGroup grupo = new BranchGroup();
        TransformGroup transGrupo = new TransformGroup();
        transGrupo.addChild(View.getViewingPlatform());

        grupo.addChild(transGrupo);

        addBranchGraph(grupo);
    }

    public UniversoSimples(Viewer viu) {
        super();
        View = viu;
        Local = new Locale(this);
        BranchGroup grupo = new BranchGroup();
        TransformGroup transGrupo = new TransformGroup();
        transGrupo.addChild(View.getViewingPlatform());


        grupo.addChild(transGrupo);

        addBranchGraph(grupo);
//        Local.addBranchGraph(new BranchGroup());
    }

    public void addBranchGraph(BranchGroup Group) {
        Local.addBranchGraph(Group);
    }

    public Canvas3D getCanvas() {
        return View.getCanvas3D();
    }

    public Viewer getView() {
        return View;
    }

    public ViewingPlatform getViewPlataform() {
        return View.getViewingPlatform();
    }
}
